package com.qf.controller;

import cn.hutool.crypto.SecureUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
public class LoginController {

    @GetMapping("/login")
    public HashMap<String,Object> login(String username,String password){
        System.out.println(username);
        System.out.println(password);

        HashMap<String, Object> hashMap = new HashMap<>();

        hashMap.put("code",1);
        hashMap.put("msg","ok");

        return hashMap;

    }


    @GetMapping("/md5")
    public String md5(String password){
        // 把password进行md5运算，然后把结果返回
        String s = SecureUtil.md5(password);
        return s;
    }

}
